package com.plian.system.wrapper.pm.propertytransaction;


import com.plian.system.dto.pm.propertytransaction.PropertyTransactionDTO;
import com.plian.system.entity.pm.propertytransaction.PropertyTransaction;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.pm.propertytransaction.PropertyTransactionVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * 产权交易备案主表包装类,返回视图层所需的字段
 *
 * @author gangan
 * @since 2019-10-12
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface PropertyTransactionWrapper extends BaseWrapper<PropertyTransaction, PropertyTransactionDTO, PropertyTransactionVO> {


	/**
	 * Entity转VO
	 *
	 * @param entity /
	 * @return /
	 */
	@Override
	@Mappings(value = {
			@Mapping(source = "reportCompanyId", target = "reportCompanyName", qualifiedByName = ORG_ID_TO_NAME),
			@Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME)
	})
	PropertyTransactionVO entityToVO(PropertyTransaction entity);
}
